<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<%@ include file="/commons/meta.jsp" %>
	<script language="javascript">
		$(function() {
			$("#publishDate").datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy-mm-dd',
				yearRange: 'c-70:c+70'
			});
		});
	</script>
</head>
<body>
<%@ include file="/WEB-INF/view/header.jsp" %>
<div id="content">
	<%@ include file="/WEB-INF/view/leftbar.jsp" %>
	<div id="main">
		<h1>
			<c:if test="${literature == null || literature.id <= 0}">文献录入</c:if>
			<c:if test="${literature != null && literature.id > 0}">文献修改</c:if>
		</h1>
		<form id="literatureForm" action="saveLiterature" method="post">
		<input type="hidden" name="id" value="${literature.id }" />
		<div class="error">
			${errorMessage }
		</div>
		<table>
			<tr>
				<td><font color="red">*</font> 文章刊号</td>
				<td><input type="text" name="issueNo" value="${literature.issueNo }" maxlength="15" />${issueNoFieldError }</td>
			</tr>
			<tr>
				<td><font color="red">*</font> 文章名称</td>
				<td><input type="text" name="title" value="${literature.title }" maxlength="50" />${titleFieldError }</td>
			</tr>
			<tr>
				<td><font color="red">*</font> 学科类别</td>
				<td>
					<select name="categoryId">
						<option value="">请选择</option>
						<c:forEach var="category" items="${categories }">
							<option value="${category.id }" <c:if test="${literature.category.id == category.id }">selected="selected"</c:if>>${category.name }</option>
						</c:forEach>
					</select>
					${categoryIdFieldError }
			</tr>
			<tr>
				<td><font color="red">*</font> 作者</td>
				<td><input type="text" name="author" value="${literature.author }" maxlength="10" />${authorFieldError }</td>
			</tr>
			<tr>
				<td><font color="red">*</font> 作者单位</td>
				<td><input type="text" name="authorFirm" value="${literature.authorFirm }" maxlength="50" />${authorFirmFieldError }</td>
			</tr>
			<tr>
				<td><font color="red">*</font> 联系方式</td>
				<td><input type="text" name="authorContactInfo" value="${literature.authorContactInfo }" maxlength="100" />${authorContactInfoFieldError }</td>
			</tr>
			<tr>
				<td><font color="red">*</font> 文章出处</td>
				<td><input type="text" name="source" value="${literature.source }" maxlength="50" />${sourceFieldError }</td>
			</tr>
			<tr>
				<td><font color="red">*</font> 发表日期</td>
				<td><input type="text" name="publishDate" id="publishDate" value="<fmt:formatDate value="${literature.publishDate }" pattern="yyyy-MM-dd" />" />${publishDateFieldError }</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input id="submitBtn" type="submit" value="提交" />
					<input id="resetBtn" type="reset" value="重置" />
				</td>
			</tr>
		</table>
		</form>
	</div>
</div>
<%@ include file="/WEB-INF/view/footer.jsp" %>
</body>
</html>